/*
 * Copyright (c) 2003, Mishkin Berteig and Christian Gruber
 *
 * $Id: Coordinate.java 254 2003-02-10 16:01:01Z cgruber $
 */
package net.israfil.foundation.collections.nspace;

import java.util.HashSet;
import java.util.Set;

/**
 * Logically an array of tuples
 *
 * @author <a href="mailto:mishkin@berteig.com">Mishkin Berteig</a>
 * @author <a href="mailto:cgruber@israfil.net">Christian Gruber</a>
 * @version $Revision: 254 $
 */
public interface Coordinate {
	
	/**
	 * A single empty Coordinate, which can be passed in to point-NSpaces, where
	 * no dimension constraint is required.
	 */
	public final static Coordinate EMPTY = 
		new Coordinate() {
			private final Set<String> dim = new HashSet<String>();

                                             public Set<String> getDimensions() {
                                                 return dim;
                                             }
			public long getDimensionality() { return 0; }
			public String getOrdinal(String dimensionName) { 
				if (false) dimensionName.hashCode(); //quiet compiler warning.
				return null;
			}	
		};

	/**
	 * Returns a set of names of contained dimensions.
	 * @return Set
	 */
	public Set<String> getDimensions();
	
	/**
	 * Returns the number of dimensions
	 * @return long
	 */
	public long getDimensionality();
	
	/**
	 * Returns the ordinal of the given named dimension..
	 * @return Set
	 */
	public String getOrdinal(String dimensionName);

}
